<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue 3 列表渲染</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
 
</head>
<body>
    <div id="app">
        <ul>
            <li v-for="(constellation, index) in constellations" :key="constellation.id">
              {{ index + 1 }} - {{ constellation.name }}
            </li>
          </ul>
    </div>

    <script>
        const { createApp, ref, computed } = Vue;

        createApp({
            setup() {
                const constellations = ref([
                { id: 1, name: '狮子座' },
                { id: 2, name: '双子座' },
                { id: 3, name: '天秤座' }
                ]);

                return { constellations };
            }
        }).mount('#app');
    </script>
</body>
</html>
